<template>
  <json-viewer :value=data :expand-depth=2 copyable></json-viewer>
</template>

<script>
import JsonViewer from "vue-json-viewer";
import utils from "../../assets/js/utils";

export default {
  name: "designer-watch",
  components: {
    JsonViewer
  },
  mounted() {
    this.query()
  },
  props: {
    watch_name: ""
  },
  data() {
    return {
      data: {}
    }
  },
  methods: {
    query: function () {
      if (utils.isEmpty(this.watch_name)) {
        this.$message({
          message: "api_name not find",
          type: "error"
        })
      } else {
        utils.getWatch(this.watch_name).then(
            response => {
              this.data = response.data.result
            }
        )
      }
    }
  }
}
</script>

<style scoped>

</style>